
;
;
;     Model statements for module:  Create 4
;

298$          CREATE,        1,MinutesToBaseTime(0.0001),Entity rb1rec# c1:MinutesToBaseTime(1440):NEXT(299$);

299$          ASSIGN:        Create for receiving b shift1 c1.NumberOut=Create for receiving b shift1 c1.NumberOut + 1
                             :NEXT(115$);


;
;
;     Model statements for module:  Decide 98
;
115$          BRANCH,        1:
                             If,((0+((day)*1440))<=tnow)&&(tnow<=(600+((day)*1440))),302$,Yes:
                             Else,303$,Yes;
302$          ASSIGN:        Decide 98.NumberOut True=Decide 98.NumberOut True + 1:NEXT(297$);

303$          ASSIGN:        Decide 98.NumberOut False=Decide 98.NumberOut False + 1:NEXT(116$);


;
;
;     Model statements for module:  Assign 198
;
297$          ASSIGN:        receiptb1# c1=
                             disc(0.924,0,0.929,1,0.940,2,0.946,6,0.951,8,0.962,9,0.973,15,0.978,16,0.984,17,0.989,18,0.995,19,1,21,67)
                             :NEXT(117$);


;
;
;     Model statements for module:  Decide 99
;
117$          BRANCH,        1:
                             If,receiptb1# c1==0,95$,Yes:
                             If,receiptb1# c1==1,118$,Yes:
                             Else,119$,Yes;

;
;
;     Model statements for module:  Separate 5
;
119$          DUPLICATE,     100 - 50:
                             receiptb1# c1-1,308$,50:NEXT(307$);

307$          ASSIGN:        Separate 5.NumberOut Orig=Separate 5.NumberOut Orig + 1:NEXT(118$);

308$          ASSIGN:        Separate 5.NumberOut Dup=Separate 5.NumberOut Dup + 1:NEXT(118$);


;
;
;     Model statements for module:  Process 10
;
118$          ASSIGN:        Process 10.NumberIn=Process 10.NumberIn + 1:
                             Process 10.WIP=Process 10.WIP+1;
338$          STACK,         1:Save:NEXT(312$);

312$          QUEUE,         Process 10.Queue;
311$          SEIZE,         2,VA:
                             Resource 4_1,1:NEXT(310$);

310$          DELAY:         HoursToBaseTime(expo(10/receiptb1# c1,3)),,VA:NEXT(353$);

353$          ASSIGN:        Process 10.WaitTime=Process 10.WaitTime + Diff.WaitTime;
317$          TALLY:         Process 10.WaitTimePerEntity,Diff.WaitTime,1;
319$          TALLY:         Process 10.TotalTimePerEntity,Diff.StartTime,1;
343$          ASSIGN:        Process 10.VATime=Process 10.VATime + Diff.VATime;
344$          TALLY:         Process 10.VATimePerEntity,Diff.VATime,1;
309$          RELEASE:       Resource 4_1,1;
358$          STACK,         1:Destroy:NEXT(357$);

357$          ASSIGN:        Process 10.NumberOut=Process 10.NumberOut + 1:
                             Process 10.WIP=Process 10.WIP-1:NEXT(87$);


;
;
;     Model statements for module:  Assign 57
;
87$           ASSIGN:        producttype=2:NEXT(180$);


;
;
;     Model statements for module:  Decide 121
;
180$          BRANCH,        1:
                             If,producttype==1,179$,Yes:
                             If,producttype==2,181$,Yes:
                             Else,182$,Yes;
182$          COUNT:         receiptctruck,1:NEXT(173$);


;
;
;     Model statements for module:  Assign 78
;
173$          ASSIGN:        receiptqenter=tnow:NEXT(171$);

171$          QUEUE,         receiptdockqueue;
161$          SEIZE,         2,Other:
                             SELECT(Docks,LRC,index),1:NEXT(162$);


;
;
;     Model statements for module:  Decide 116
;
162$          BRANCH,        1:
                             If,docks(index)==dock1,362$,Yes:
                             Else,363$,Yes;
362$          ASSIGN:        Decide 116.NumberOut True=Decide 116.NumberOut True + 1:NEXT(174$);

363$          ASSIGN:        Decide 116.NumberOut False=Decide 116.NumberOut False + 1:NEXT(239$);

174$          TALLY:         time in receiptq at d1,tnow-receiptqenter,1:NEXT(1$);


;
;
;     Model statements for module:  Assign 2
;
1$            ASSIGN:        truckcap=8:
                             dockno=1:NEXT(2$);

2$            DUPLICATE:     truckcap-1,69$:NEXT(69$);


;
;
;     Model statements for module:  Process 1
;
69$           ASSIGN:        Unloading from dock 1.NumberIn=Unloading from dock 1.NumberIn + 1:
                             Unloading from dock 1.WIP=Unloading from dock 1.WIP+1;
393$          STACK,         1:Save:NEXT(367$);

367$          QUEUE,         Unloading from dock 1.Queue;
366$          SEIZE,         1,VA:
                             SELECT(TransSet4,SNB, ),1:NEXT(365$);

365$          DELAY:         SecondsToBaseTime(UNIF(62,83,61)),,VA:NEXT(408$);

408$          ASSIGN:        Unloading from dock 1.WaitTime=Unloading from dock 1.WaitTime + Diff.WaitTime;
372$          TALLY:         Unloading from dock 1.WaitTimePerEntity,Diff.WaitTime,1;
374$          TALLY:         Unloading from dock 1.TotalTimePerEntity,Diff.StartTime,1;
398$          ASSIGN:        Unloading from dock 1.VATime=Unloading from dock 1.VATime + Diff.VATime;
399$          TALLY:         Unloading from dock 1.VATimePerEntity,Diff.VATime,1;
364$          RELEASE:       SELECT(TransSet4,LAST),1;
413$          STACK,         1:Destroy:NEXT(412$);

412$          ASSIGN:        Unloading from dock 1.NumberOut=Unloading from dock 1.NumberOut + 1:
                             Unloading from dock 1.WIP=Unloading from dock 1.WIP-1:NEXT(241$);


;
;
;     Model statements for module:  Assign 110
;
241$          ASSIGN:        beginning time for putaway from d1=tnow:NEXT(165$);

165$          ASSIGN:        product3stock=(producttype==3)*(product3stock+1)+(producttype<>3)*(product3stock+0):
                             product2stock=(producttype==2)*(product2stock+1)+(producttype<>2)*(product2stock+0):
                             product1stock=(producttype==1)*(product1stock+1)+(producttype<>1)*(product1stock+0);
167$          WRITE,         stockr:
                             totalstock,
                             tnow:NEXT(3$);


;
;
;     Model statements for module:  Assign 3
;
3$            ASSIGN:        i=1:NEXT(4$);


;
;
;     Model statements for module:  Assign 4
;
4$            ASSIGN:        replaced=0:NEXT(5$);

5$            WHILE:         (replaced==0):NEXT(8$);


;
;
;     Model statements for module:  Decide 3
;
8$            BRANCH,        1:
                             If,(LocationA(i,1) == 0) ||  ( (producttype  ==  LocationA (i,2)) && (LocationA(i,1) < Capacity) ),
                             415$,Yes:
                             Else,416$,Yes;
415$          ASSIGN:        Decide 3.NumberOut True=Decide 3.NumberOut True + 1:NEXT(7$);

416$          ASSIGN:        Decide 3.NumberOut False=Decide 3.NumberOut False + 1:NEXT(10$);

7$            ASSIGN:        LocationA(i,1)=LocationA(i,1)+1:
                             LocationA(i,2)=producttype:NEXT(11$);


;
;
;     Model statements for module:  Assign 11
;
11$           ASSIGN:        Locationtype=1:NEXT(57$);


;
;
;     Model statements for module:  Decide 45
;
57$           BRANCH,        1:
                             If,dockno==1,417$,Yes:
                             Else,418$,Yes;
417$          ASSIGN:        Decide 45.NumberOut True=Decide 45.NumberOut True + 1:NEXT(264$);

418$          ASSIGN:        Decide 45.NumberOut False=Decide 45.NumberOut False + 1:NEXT(263$);


;
;
;     Model statements for module:  Assign 183
;
264$          ASSIGN:        width1=
                             (LocationA(i,1)==1)*4+(LocationA(i,1)==2)*3+(LocationA(i,1)==3)*2+(LocationA(i,1)==4)*1+(LocationA(i,1)==5)*0:
                             distance1=20+i*1+width1:NEXT(13$);


;
;
;     Model statements for module:  Assign 13
;
13$           ASSIGN:        replaced=1:NEXT(14$);

14$           ENDWHILE:NEXT(54$);


;
;
;     Model statements for module:  Decide 44
;
54$           BRANCH,        1:
                             If,dockno==1,419$,Yes:
                             Else,420$,Yes;
419$          ASSIGN:        Decide 44.NumberOut True=Decide 44.NumberOut True + 1:NEXT(16$);

420$          ASSIGN:        Decide 44.NumberOut False=Decide 44.NumberOut False + 1:NEXT(55$);


;
;
;     Model statements for module:  Seize 2
;
16$           QUEUE,         Seizing a forklift from forklift set at receiving ramp1.Queue;
              SEIZE,         2,Other:
                             SELECT(TransSet1,CYC, trans_no1),1:NEXT(422$);

422$          DELAY:         0.0,,VA:NEXT(283$);


;
;
;     Model statements for module:  Decide 229
;
283$          BRANCH,        1:
                             If,stock exceeded<>1,423$,Yes:
                             Else,424$,Yes;
423$          ASSIGN:        Decide 229.NumberOut True=Decide 229.NumberOut True + 1:NEXT(18$);

424$          ASSIGN:        Decide 229.NumberOut False=Decide 229.NumberOut False + 1:NEXT(284$);


;
;
;     Model statements for module:  Delay 1
;
18$           DELAY:         
                             SecondsToBaseTime((Locationtype==1)*((34.521+(0.915*distance1)+NORM(0,7.3))*2)+(Locationtype==2)*((34.521+(0.915*distance3)+NORM(0,7.3))*2)+(Locationtype==3)*((34.521+(0.915*distance5)+NORM(0,7.3))*2)+(Locationtype==4)*((34.521+(0.915*distance7)+NORM(0,7.3))*2)),,
                             Other:NEXT(19$);

19$           RELEASE:       Member(TransSet1, Trans_No1),1;
243$          TALLY:         time for putaway from d1,tnow-beginning time for putaway from d1,1;
214$          ASSIGN:        #unloaded1=#unloaded1+1:NEXT(20$);


;
;
;     Model statements for module:  Decide 6
;
20$           BRANCH,        1:
                             If,#unloaded1==truckcap,425$,Yes:
                             Else,426$,Yes;
425$          ASSIGN:        Decide 6.NumberOut True=Decide 6.NumberOut True + 1:NEXT(21$);

426$          ASSIGN:        Decide 6.NumberOut False=Decide 6.NumberOut False + 1:NEXT(15$);


;
;
;     Model statements for module:  Release 1
;
21$           RELEASE:       dock1,1:NEXT(184$);

184$          TALLY:         time in system from d1,tnow-receiptqenter,1;
215$          ASSIGN:        #unloaded1=#unloaded1-#unloaded1:NEXT(15$);


;
;
;     Model statements for module:  Dispose 1
;
15$           ASSIGN:        Dispose 1.NumberOut=Dispose 1.NumberOut + 1;
427$          DISPOSE:       Yes;


;
;
;     Model statements for module:  Delay 14
;
284$          DELAY:         SecondsToBaseTime(((34.521+(0.915*averagedistance)+Norm(0,7.3))*2)),,Other:NEXT(19$);


;
;
;     Model statements for module:  Seize 15
;
55$           QUEUE,         Seizing a forklift from forklift set at receiving ramp2.Queue;
              SEIZE,         2,Other:
                             SELECT(TransSet2,CYC, trans_no2),1:NEXT(429$);

429$          DELAY:         0.0,,VA:NEXT(286$);


;
;
;     Model statements for module:  Decide 230
;
286$          BRANCH,        1:
                             If,stock exceeded<>1,430$,Yes:
                             Else,431$,Yes;
430$          ASSIGN:        Decide 230.NumberOut True=Decide 230.NumberOut True + 1:NEXT(58$);

431$          ASSIGN:        Decide 230.NumberOut False=Decide 230.NumberOut False + 1:NEXT(285$);


;
;
;     Model statements for module:  Delay 11
;
58$           DELAY:         
                             SecondsToBaseTime((Locationtype==1)*((34.521+(0.915*distance2)+NORM(0,7.3))*2)+(Locationtype==2)*((34.521+(0.915*distance4)+NORM(0,7.3))*2)+(Locationtype==3)*((34.521+(0.915*distance6)+NORM(0,7.3))*2)+(Locationtype==4)*((34.521+(0.915*distance8)+NORM(0,7.3))*2)),,
                             Other:NEXT(59$);

59$           RELEASE:       Member(TransSet2, Trans_No2),1;
244$          TALLY:         time for putaway from d2,tnow-beginning time for putaway from d2,1;
216$          ASSIGN:        #unloaded2=#unloaded2+1:NEXT(61$);


;
;
;     Model statements for module:  Decide 56
;
61$           BRANCH,        1:
                             If,#unloaded2==truckcap,432$,Yes:
                             Else,433$,Yes;
432$          ASSIGN:        Decide 56.NumberOut True=Decide 56.NumberOut True + 1:NEXT(62$);

433$          ASSIGN:        Decide 56.NumberOut False=Decide 56.NumberOut False + 1:NEXT(60$);


;
;
;     Model statements for module:  Release 15
;
62$           RELEASE:       dock2,1:NEXT(183$);

183$          TALLY:         time in system from d2,tnow-receiptqenter,1;
217$          ASSIGN:        #unloaded2=#unloaded2-#unloaded2:NEXT(60$);


;
;
;     Model statements for module:  Dispose 15
;
60$           ASSIGN:        Dispose 15.NumberOut=Dispose 15.NumberOut + 1;
434$          DISPOSE:       Yes;


;
;
;     Model statements for module:  Delay 15
;
285$          DELAY:         SecondsToBaseTime(((34.521+(0.915*averagedistance)+Norm(0,7.3))*2)),,Other:NEXT(59$);


;
;
;     Model statements for module:  Assign 182
;
263$          ASSIGN:        width2=
                             (LocationA(i,1)==1)*4+(LocationA(i,1)==2)*3+(LocationA(i,1)==3)*2+(LocationA(i,1)==4)*1+(LocationA(i,1)==5)*0:
                             distance2=23+i*1+width2:NEXT(13$);


;
;
;     Model statements for module:  Decide 4
;
10$           BRANCH,        1:
                             If,
                             ((LocationB(i,1) == 0) ||  ( (producttype  ==  LocationB (i,2)) && (LocationB(i,1) < Capacity) )),
                             435$,Yes:
                             Else,436$,Yes;
435$          ASSIGN:        Decide 4.NumberOut True=Decide 4.NumberOut True + 1:NEXT(6$);

436$          ASSIGN:        Decide 4.NumberOut False=Decide 4.NumberOut False + 1:NEXT(71$);

6$            ASSIGN:        LocationB(i,1)=LocationB(i,1)+1:
                             LocationB(i,2)=producttype:NEXT(12$);


;
;
;     Model statements for module:  Assign 12
;
12$           ASSIGN:        Locationtype=2:NEXT(265$);


;
;
;     Model statements for module:  Decide 223
;
265$          BRANCH,        1:
                             If,dockno==1,437$,Yes:
                             Else,438$,Yes;
437$          ASSIGN:        Decide 223.NumberOut True=Decide 223.NumberOut True + 1:NEXT(266$);

438$          ASSIGN:        Decide 223.NumberOut False=Decide 223.NumberOut False + 1:NEXT(267$);


;
;
;     Model statements for module:  Assign 184
;
266$          ASSIGN:        width3=
                             (LocationB(i,1)==1)*4+(LocationB(i,1)==2)*3+(LocationB(i,1)==3)*2+(LocationB(i,1)==4)*1+(LocationB(i,1)==5)*0:
                             distance3=20+i*1+width3:NEXT(13$);


;
;
;     Model statements for module:  Assign 186
;
267$          ASSIGN:        width4=
                             (LocationB(i,1)==1)*4+(LocationB(i,1)==2)*3+(LocationB(i,1)==3)*2+(LocationB(i,1)==4)*1+(LocationB(i,1)==5)*0:
                             distance4=23+i*1+width4:NEXT(13$);


;
;
;     Model statements for module:  Decide 67
;
71$           BRANCH,        1:
                             If,((LocationC(i,1) == 0) ||  ( (producttype  ==  LocationC (i,2)) && (LocationC(i,1) < 8) )),439$,
                             Yes:
                             Else,440$,Yes;
439$          ASSIGN:        Decide 67.NumberOut True=Decide 67.NumberOut True + 1:NEXT(72$);

440$          ASSIGN:        Decide 67.NumberOut False=Decide 67.NumberOut False + 1:NEXT(150$);

72$           ASSIGN:        LocationC(i,1)=LocationC(i,1)+1:
                             LocationC(i,2)=producttype:NEXT(73$);


;
;
;     Model statements for module:  Assign 49
;
73$           ASSIGN:        Locationtype=3:NEXT(74$);


;
;
;     Model statements for module:  Decide 68
;
74$           BRANCH,        1:
                             If,dockno==1,441$,Yes:
                             Else,442$,Yes;
441$          ASSIGN:        Decide 68.NumberOut True=Decide 68.NumberOut True + 1:NEXT(75$);

442$          ASSIGN:        Decide 68.NumberOut False=Decide 68.NumberOut False + 1:NEXT(76$);


;
;
;     Model statements for module:  Assign 51
;
75$           ASSIGN:        width5=
                             (LocationC(i,1)==1)*7+(LocationC(i,1)==2)*6+(LocationC(i,1)==3)*5+(LocationC(i,1)==4)*4+(LocationC(i,1)==5)*3+(LocationC(i,1)==6)*2+(LocationC(i,1)==7)*1+(LocationC(i,1)==8)*0:
                             distance5=13+i*1+width5:NEXT(13$);


;
;
;     Model statements for module:  Assign 52
;
76$           ASSIGN:        width6=
                             (LocationC(i,1)==1)*7+(LocationC(i,1)==2)*6+(LocationC(i,1)==3)*5+(LocationC(i,1)==4)*4+(LocationC(i,1)==5)*3+(LocationC(i,1)==6)*2+(LocationC(i,1)==7)*1+(LocationC(i,1)==8)*0:
                             distance6=14+i*1+width6:NEXT(13$);


;
;
;     Model statements for module:  Decide 110
;
150$          BRANCH,        1:
                             If,((LocationD(i,1) == 0) ||  ( (producttype  ==  LocationD (i,2)) && (LocationD(i,1) < 8) )),443$,
                             Yes:
                             Else,444$,Yes;
443$          ASSIGN:        Decide 110.NumberOut True=Decide 110.NumberOut True + 1:NEXT(151$);

444$          ASSIGN:        Decide 110.NumberOut False=Decide 110.NumberOut False + 1:NEXT(9$);

151$          ASSIGN:        LocationD(i,1)=LocationD(i,1)+1:
                             LocationD(i,2)=producttype:NEXT(152$);


;
;
;     Model statements for module:  Assign 76
;
152$          ASSIGN:        Locationtype=4:NEXT(268$);


;
;
;     Model statements for module:  Decide 224
;
268$          BRANCH,        1:
                             If,dockno==1,445$,Yes:
                             Else,446$,Yes;
445$          ASSIGN:        Decide 224.NumberOut True=Decide 224.NumberOut True + 1:NEXT(269$);

446$          ASSIGN:        Decide 224.NumberOut False=Decide 224.NumberOut False + 1:NEXT(270$);


;
;
;     Model statements for module:  Assign 189
;
269$          ASSIGN:        width7=
                             (LocationD(i,1)==1)*7+(LocationD(i,1)==2)*6+(LocationD(i,1)==3)*5+(LocationD(i,1)==4)*4+(LocationD(i,1)==5)*3+(LocationD(i,1)==6)*2+(LocationD(i,1)==7)*1+(LocationD(i,1)==8)*0:
                             distance7=13+i*1+width7:NEXT(13$);


;
;
;     Model statements for module:  Assign 190
;
270$          ASSIGN:        width8=
                             (LocationD(i,1)==1)*7+(LocationD(i,1)==2)*6+(LocationD(i,1)==3)*5+(LocationD(i,1)==4)*4+(LocationD(i,1)==5)*3+(LocationD(i,1)==6)*2+(LocationD(i,1)==7)*1+(LocationD(i,1)==8)*0:
                             distance8=14+i*1+width8:NEXT(13$);


;
;
;     Model statements for module:  Assign 10
;
9$            ASSIGN:        i=i+1:NEXT(281$);


;
;
;     Model statements for module:  Decide 228
;
281$          BRANCH,        1:
                             If,i<=100,447$,Yes:
                             Else,448$,Yes;
447$          ASSIGN:        Decide 228.NumberOut True=Decide 228.NumberOut True + 1:NEXT(14$);

448$          ASSIGN:        Decide 228.NumberOut False=Decide 228.NumberOut False + 1:NEXT(282$);


;
;
;     Model statements for module:  Assign 196
;
282$          ASSIGN:        stock exceeded=1:NEXT(277$);


;
;
;     Model statements for module:  Decide 227
;
277$          BRANCH,        1:
                             If,producttype==1,278$,Yes:
                             If,producttype==2,279$,Yes:
                             Else,280$,Yes;
280$          ASSIGN:        stock3=stock3+1:NEXT(54$);

278$          ASSIGN:        stock1=stock1+1:NEXT(54$);

279$          ASSIGN:        stock2=stock2+1:NEXT(54$);

239$          TALLY:         time in receiptq at d2,tnow-receiptqenter,1:NEXT(22$);


;
;
;     Model statements for module:  Assign 15
;
22$           ASSIGN:        truckcap=8:
                             dockno=2:NEXT(23$);

23$           DUPLICATE:     truckcap-1,70$:NEXT(70$);


;
;
;     Model statements for module:  Process 2
;
70$           ASSIGN:        Unloading from dock 2.NumberIn=Unloading from dock 2.NumberIn + 1:
                             Unloading from dock 2.WIP=Unloading from dock 2.WIP+1;
480$          STACK,         1:Save:NEXT(454$);

454$          QUEUE,         Unloading from dock 2.Queue;
453$          SEIZE,         1,VA:
                             SELECT(TransSet5,SNB, ),1:NEXT(452$);

452$          DELAY:         SecondsToBaseTime(UNIF(62,83,62)),,VA:NEXT(495$);

495$          ASSIGN:        Unloading from dock 2.WaitTime=Unloading from dock 2.WaitTime + Diff.WaitTime;
459$          TALLY:         Unloading from dock 2.WaitTimePerEntity,Diff.WaitTime,1;
461$          TALLY:         Unloading from dock 2.TotalTimePerEntity,Diff.StartTime,1;
485$          ASSIGN:        Unloading from dock 2.VATime=Unloading from dock 2.VATime + Diff.VATime;
486$          TALLY:         Unloading from dock 2.VATimePerEntity,Diff.VATime,1;
451$          RELEASE:       SELECT(TransSet5,LAST),1;
500$          STACK,         1:Destroy:NEXT(499$);

499$          ASSIGN:        Unloading from dock 2.NumberOut=Unloading from dock 2.NumberOut + 1:
                             Unloading from dock 2.WIP=Unloading from dock 2.WIP-1:NEXT(242$);


;
;
;     Model statements for module:  Assign 111
;
242$          ASSIGN:        beginning time for putaway from d2=tnow:NEXT(165$);

179$          COUNT:         receiptatruck,1:NEXT(173$);

181$          COUNT:         receiptbtruck,1:NEXT(173$);


;
;
;     Model statements for module:  Dispose 16
;
95$           ASSIGN:        Dispose 16.NumberOut=Dispose 16.NumberOut + 1;
502$          DISPOSE:       Yes;


;
;
;     Model statements for module:  Assign 69
;
116$          ASSIGN:        receiptb2# c1=
                             disc(0.929,0,0.935,1,0.946,7,0.957,8,0.967,12,0.973,15,0.978,17,0.984,19,0.989,21,0.995,27,1,28,68)
                             :NEXT(120$);


;
;
;     Model statements for module:  Decide 100
;
120$          BRANCH,        1:
                             If,receiptb2# c1==0,95$,Yes:
                             If,receiptb2# c1==1,121$,Yes:
                             Else,122$,Yes;

;
;
;     Model statements for module:  Separate 6
;
122$          DUPLICATE,     100 - 50:
                             receiptb2# c1-1,507$,50:NEXT(506$);

506$          ASSIGN:        Separate 6.NumberOut Orig=Separate 6.NumberOut Orig + 1:NEXT(121$);

507$          ASSIGN:        Separate 6.NumberOut Dup=Separate 6.NumberOut Dup + 1:NEXT(121$);


;
;
;     Model statements for module:  Process 11
;
121$          ASSIGN:        Process 11.NumberIn=Process 11.NumberIn + 1:
                             Process 11.WIP=Process 11.WIP+1;
537$          STACK,         1:Save:NEXT(511$);

511$          QUEUE,         Process 11.Queue;
510$          SEIZE,         2,VA:
                             Resource 5,1:NEXT(509$);

509$          DELAY:         HoursToBaseTime(expo(14/receiptb2# c1,4)),,VA:NEXT(552$);

552$          ASSIGN:        Process 11.WaitTime=Process 11.WaitTime + Diff.WaitTime;
516$          TALLY:         Process 11.WaitTimePerEntity,Diff.WaitTime,1;
518$          TALLY:         Process 11.TotalTimePerEntity,Diff.StartTime,1;
542$          ASSIGN:        Process 11.VATime=Process 11.VATime + Diff.VATime;
543$          TALLY:         Process 11.VATimePerEntity,Diff.VATime,1;
508$          RELEASE:       Resource 5,1;
557$          STACK,         1:Destroy:NEXT(556$);

556$          ASSIGN:        Process 11.NumberOut=Process 11.NumberOut + 1:
                             Process 11.WIP=Process 11.WIP-1:NEXT(87$);


;
;
;     Model statements for module:  Create 5
;

559$          CREATE,        1,MinutesToBaseTime(0.0001),Entity rc1rec# c1:MinutesToBaseTime(1440):NEXT(560$);

560$          ASSIGN:        Create for receiving c shift1 c1.NumberOut=Create for receiving c shift1 c1.NumberOut + 1
                             :NEXT(123$);


;
;
;     Model statements for module:  Decide 101
;
123$          BRANCH,        1:
                             If,((0+((day)*1440))<=tnow)&&(tnow<=(600+((day)*1440))),563$,Yes:
                             Else,564$,Yes;
563$          ASSIGN:        Decide 101.NumberOut True=Decide 101.NumberOut True + 1:NEXT(124$);

564$          ASSIGN:        Decide 101.NumberOut False=Decide 101.NumberOut False + 1:NEXT(125$);


;
;
;     Model statements for module:  Assign 70
;
124$          ASSIGN:        receiptc1# c1=disc(0.848,0,0.859,1,0.880,2,0.902,3,0.935,4,0.962,5,0.973,6,0.989,7,0.995,8,1,10,69)
                             :NEXT(126$);


;
;
;     Model statements for module:  Decide 102
;
126$          BRANCH,        1:
                             If,receiptc1# c1==0,95$,Yes:
                             If,receiptc1# c1==1,127$,Yes:
                             Else,128$,Yes;

;
;
;     Model statements for module:  Separate 7
;
128$          DUPLICATE,     100 - 50:
                             receiptc1# c1-1,569$,50:NEXT(568$);

568$          ASSIGN:        Separate 7.NumberOut Orig=Separate 7.NumberOut Orig + 1:NEXT(127$);

569$          ASSIGN:        Separate 7.NumberOut Dup=Separate 7.NumberOut Dup + 1:NEXT(127$);


;
;
;     Model statements for module:  Process 12
;
127$          ASSIGN:        Process 12.NumberIn=Process 12.NumberIn + 1:
                             Process 12.WIP=Process 12.WIP+1;
599$          STACK,         1:Save:NEXT(573$);

573$          QUEUE,         Process 12.Queue;
572$          SEIZE,         2,VA:
                             Resource 6,1:NEXT(571$);

571$          DELAY:         HoursToBaseTime(expo(10/receiptc1# c1,5)),,VA:NEXT(614$);

614$          ASSIGN:        Process 12.WaitTime=Process 12.WaitTime + Diff.WaitTime;
578$          TALLY:         Process 12.WaitTimePerEntity,Diff.WaitTime,1;
580$          TALLY:         Process 12.TotalTimePerEntity,Diff.StartTime,1;
604$          ASSIGN:        Process 12.VATime=Process 12.VATime + Diff.VATime;
605$          TALLY:         Process 12.VATimePerEntity,Diff.VATime,1;
570$          RELEASE:       Resource 6,1;
619$          STACK,         1:Destroy:NEXT(618$);

618$          ASSIGN:        Process 12.NumberOut=Process 12.NumberOut + 1:
                             Process 12.WIP=Process 12.WIP-1:NEXT(88$);


;
;
;     Model statements for module:  Assign 58
;
88$           ASSIGN:        producttype=3:NEXT(180$);


;
;
;     Model statements for module:  Assign 71
;
125$          ASSIGN:        receiptc2# c1=disc(0.848,0,0.864,1,0.875,2,0.913,3,0.946,4,0.973,5,0.989,6,0.995,8,1,10,70)
                             :NEXT(129$);


;
;
;     Model statements for module:  Decide 103
;
129$          BRANCH,        1:
                             If,receiptc2# c1==0,95$,Yes:
                             If,receiptc2# c1==1,130$,Yes:
                             Else,131$,Yes;

;
;
;     Model statements for module:  Separate 8
;
131$          DUPLICATE,     100 - 50:
                             receiptc2# c1-1,625$,50:NEXT(624$);

624$          ASSIGN:        Separate 8.NumberOut Orig=Separate 8.NumberOut Orig + 1:NEXT(130$);

625$          ASSIGN:        Separate 8.NumberOut Dup=Separate 8.NumberOut Dup + 1:NEXT(130$);


;
;
;     Model statements for module:  Process 13
;
130$          ASSIGN:        Process 13.NumberIn=Process 13.NumberIn + 1:
                             Process 13.WIP=Process 13.WIP+1;
655$          STACK,         1:Save:NEXT(629$);

629$          QUEUE,         Process 13.Queue;
628$          SEIZE,         2,VA:
                             Resource 7,1:NEXT(627$);

627$          DELAY:         HoursToBaseTime(expo(14/receiptc2# c1,6)),,VA:NEXT(670$);

670$          ASSIGN:        Process 13.WaitTime=Process 13.WaitTime + Diff.WaitTime;
634$          TALLY:         Process 13.WaitTimePerEntity,Diff.WaitTime,1;
636$          TALLY:         Process 13.TotalTimePerEntity,Diff.StartTime,1;
660$          ASSIGN:        Process 13.VATime=Process 13.VATime + Diff.VATime;
661$          TALLY:         Process 13.VATimePerEntity,Diff.VATime,1;
626$          RELEASE:       Resource 7,1;
675$          STACK,         1:Destroy:NEXT(674$);

674$          ASSIGN:        Process 13.NumberOut=Process 13.NumberOut + 1:
                             Process 13.WIP=Process 13.WIP-1:NEXT(88$);


;
;
;     Model statements for module:  Create 6
;

677$          CREATE,        1,MinutesToBaseTime(0.0001),Entity sb1ship# c1:MinutesToBaseTime(1440):NEXT(678$);

678$          ASSIGN:        Create for shipment b shift1 c1.NumberOut=Create for shipment b shift1 c1.NumberOut + 1:NEXT(132$);


;
;
;     Model statements for module:  Decide 104
;
132$          BRANCH,        1:
                             If,((0+((day)*1440))<=tnow)&&(tnow<=(600+((day)*1440))),681$,Yes:
                             Else,682$,Yes;
681$          ASSIGN:        Decide 104.NumberOut True=Decide 104.NumberOut True + 1:NEXT(133$);

682$          ASSIGN:        Decide 104.NumberOut False=Decide 104.NumberOut False + 1:NEXT(134$);


;
;
;     Model statements for module:  Assign 72
;
133$          ASSIGN:        departureb1# c1=disc(0.674,0,0.717,1,0.783,2,0.810,3,0.918,4,0.973,5,1,6,97):NEXT(135$);


;
;
;     Model statements for module:  Decide 105
;
135$          BRANCH,        1:
                             If,departureb1# c1==0,108$,Yes:
                             If,departureb1# c1==1,136$,Yes:
                             Else,137$,Yes;

;
;
;     Model statements for module:  Separate 9
;
137$          DUPLICATE,     100 - 50:
                             departureb1# c1-1,687$,50:NEXT(686$);

686$          ASSIGN:        Separate 9.NumberOut Orig=Separate 9.NumberOut Orig + 1:NEXT(136$);

687$          ASSIGN:        Separate 9.NumberOut Dup=Separate 9.NumberOut Dup + 1:NEXT(136$);


;
;
;     Model statements for module:  Process 14
;
136$          ASSIGN:        Process 14.NumberIn=Process 14.NumberIn + 1:
                             Process 14.WIP=Process 14.WIP+1;
717$          STACK,         1:Save:NEXT(691$);

691$          QUEUE,         Process 14.Queue;
690$          SEIZE,         2,VA:
                             Resource 8,1:NEXT(689$);

689$          DELAY:         HoursToBaseTime(expo(10/departureb1# c1,33)),,VA:NEXT(732$);

732$          ASSIGN:        Process 14.WaitTime=Process 14.WaitTime + Diff.WaitTime;
696$          TALLY:         Process 14.WaitTimePerEntity,Diff.WaitTime,1;
698$          TALLY:         Process 14.TotalTimePerEntity,Diff.StartTime,1;
722$          ASSIGN:        Process 14.VATime=Process 14.VATime + Diff.VATime;
723$          TALLY:         Process 14.VATimePerEntity,Diff.VATime,1;
688$          RELEASE:       Resource 8,1;
737$          STACK,         1:Destroy:NEXT(736$);

736$          ASSIGN:        Process 14.NumberOut=Process 14.NumberOut + 1:
                             Process 14.WIP=Process 14.WIP-1:NEXT(90$);


;
;
;     Model statements for module:  Assign 60
;
90$           ASSIGN:        type=2:NEXT(158$);


;
;
;     Model statements for module:  Decide 115
;
158$          BRANCH,        1:
                             If,type==1,168$,Yes:
                             If,type==2,169$,Yes:
                             Else,170$,Yes;

;
;
;     Model statements for module:  Decide 120
;
170$          BRANCH,        1:
                             If,product3stock>=safety stock,741$,Yes:
                             Else,742$,Yes;
741$          ASSIGN:        Decide 120.NumberOut True=Decide 120.NumberOut True + 1:NEXT(224$);

742$          ASSIGN:        Decide 120.NumberOut False=Decide 120.NumberOut False + 1:NEXT(160$);

224$          COUNT:         dispatchctruck,1:NEXT(24$);


;
;
;     Model statements for module:  Assign 23
;
24$           ASSIGN:        ordersize=8:
                             shipmentqenter=tnow:NEXT(68$);

68$           ASSIGN:        product2stock=(type==2)*(product2stock-8)+(type<>2)*(product2stock-0):
                             product3stock=(type==3)*(product3stock-8)+(type<>3)*(product3stock-0):
                             product1stock=(type==1)*(product1stock-8)+(type<>1)*(product1stock-0);
166$          WRITE,         stock:
                             totalstock,
                             tnow;
172$          QUEUE,         shipmentdockqueue;
163$          SEIZE,         1,Other:
                             SELECT(S_docks,LRC,s_index),1:NEXT(164$);


;
;
;     Model statements for module:  Decide 117
;
164$          BRANCH,        1:
                             If,s_docks(s_index)==dock1,743$,Yes:
                             Else,744$,Yes;
743$          ASSIGN:        Decide 117.NumberOut True=Decide 117.NumberOut True + 1:NEXT(175$);

744$          ASSIGN:        Decide 117.NumberOut False=Decide 117.NumberOut False + 1:NEXT(240$);

175$          TALLY:         time in shipmentq at d1,tnow-shipmentqenter,1:NEXT(66$);


;
;
;     Model statements for module:  Assign 47
;
66$           ASSIGN:        dock_no=1:
                             leave the dock1 queue=tnow:NEXT(26$);

26$           DUPLICATE:     ordersize-1,25$:NEXT(25$);


;
;
;     Model statements for module:  Assign 24
;
25$           ASSIGN:        picked=0:
                             k=1:
                             totalstock=product1stock+product2stock+product3stock:
                             totalexceedingstock=stock1+stock2+stock3:NEXT(27$);

27$           WHILE:         (picked==0):NEXT(28$);


;
;
;     Model statements for module:  Decide 17
;
28$           BRANCH,        1:
                             If,( LocationA(k,1) <> 0  )  &&  ( type == LocationA(k,2) ),745$,Yes:
                             Else,746$,Yes;
745$          ASSIGN:        Decide 17.NumberOut True=Decide 17.NumberOut True + 1:NEXT(29$);

746$          ASSIGN:        Decide 17.NumberOut False=Decide 17.NumberOut False + 1:NEXT(33$);

29$           ASSIGN:        LocationA(k,1)=LocationA(k,1)-1:NEXT(30$);


;
;
;     Model statements for module:  Assign 27
;
30$           ASSIGN:        picked=1:
                             Locationtype=1:NEXT(31$);


;
;
;     Model statements for module:  Decide 18
;
31$           BRANCH,        1:
                             If,LocationA(k,1)==0,747$,Yes:
                             Else,748$,Yes;
747$          ASSIGN:        Decide 18.NumberOut True=Decide 18.NumberOut True + 1:NEXT(32$);

748$          ASSIGN:        Decide 18.NumberOut False=Decide 18.NumberOut False + 1:NEXT(63$);

32$           ASSIGN:        LocationA(k,2)=0:NEXT(63$);


;
;
;     Model statements for module:  Decide 57
;
63$           BRANCH,        1:
                             If,dock_no==1,749$,Yes:
                             Else,750$,Yes;
749$          ASSIGN:        Decide 57.NumberOut True=Decide 57.NumberOut True + 1:NEXT(64$);

750$          ASSIGN:        Decide 57.NumberOut False=Decide 57.NumberOut False + 1:NEXT(65$);


;
;
;     Model statements for module:  Assign 43
;
64$           ASSIGN:        width9=
                             (LocationA(k,1)==4)*0+(LocationA(k,1)==3)*1+(LocationA(k,1)==2)*2+(LocationA(k,1)==1)*3+(LocationA(k,1)==0)*4:
                             distance9=20+k*1+width9:NEXT(38$);

38$           ENDWHILE:NEXT(42$);


;
;
;     Model statements for module:  Decide 22
;
42$           BRANCH,        1:
                             If,dock_no==1,751$,Yes:
                             Else,752$,Yes;
751$          ASSIGN:        Decide 22.NumberOut True=Decide 22.NumberOut True + 1:NEXT(40$);

752$          ASSIGN:        Decide 22.NumberOut False=Decide 22.NumberOut False + 1:NEXT(50$);


;
;
;     Model statements for module:  Seize 9
;
40$           QUEUE,         Seizing a forklift from forklift set at shipment ramp1.Queue;
              SEIZE,         2,Other:
                             SELECT(TransSet3,CYC, trans_no3),1:NEXT(754$);

754$          DELAY:         0.0,,VA:NEXT(293$);


;
;
;     Model statements for module:  Decide 233
;
293$          BRANCH,        1:
                             If,departure from stock exceeded<>1,755$,Yes:
                             Else,756$,Yes;
755$          ASSIGN:        Decide 233.NumberOut True=Decide 233.NumberOut True + 1:NEXT(43$);

756$          ASSIGN:        Decide 233.NumberOut False=Decide 233.NumberOut False + 1:NEXT(294$);


;
;
;     Model statements for module:  Delay 5
;
43$           DELAY:         
                             SecondsToBaseTime((Locationtype==1)*((34.521+(0.915*distance9)+NORM(0,7.3))*2)+(Locationtype==2)*((34.521+(0.915*distance11)+NORM(0,7.3))*2)+(Locationtype==3)*((34.521+(0.915*distance13)+NORM(0,7.3))*2)+(Locationtype==4)*((34.521+(0.915*distance15)+NORM(0,7.3))*2)),,
                             Other:NEXT(93$);

93$           RELEASE:       Member(TransSet3, trans_no3),1;
250$          ASSIGN:        #product from d1=#product from d1+1:NEXT(189$);


;
;
;     Model statements for module:  Decide 123
;
189$          BRANCH,        1:
                             If,#product from d1==8,757$,Yes:
                             Else,758$,Yes;
757$          ASSIGN:        Decide 123.NumberOut True=Decide 123.NumberOut True + 1:NEXT(228$);

758$          ASSIGN:        Decide 123.NumberOut False=Decide 123.NumberOut False + 1:NEXT(258$);

228$          TALLY:         time for pickup to d1,tnow-leave the dock1 queue,1;
251$          ASSIGN:        #product from d1=#product from d1-#product from d1:NEXT(86$);


;
;
;     Model statements for module:  Process 5
;
86$           ASSIGN:        Loading from dock1.NumberIn=Loading from dock1.NumberIn + 1:
                             Loading from dock1.WIP=Loading from dock1.WIP+1;
788$          STACK,         1:Save:NEXT(762$);

762$          QUEUE,         Loading from dock1.Queue;
761$          SEIZE,         1,VA:
                             SELECT(TransSet4,SNB, ),1:NEXT(760$);

760$          DELAY:         SecondsToBaseTime(UNIF(62,83,63)),,VA:NEXT(803$);

803$          ASSIGN:        Loading from dock1.WaitTime=Loading from dock1.WaitTime + Diff.WaitTime;
767$          TALLY:         Loading from dock1.WaitTimePerEntity,Diff.WaitTime,1;
769$          TALLY:         Loading from dock1.TotalTimePerEntity,Diff.StartTime,1;
793$          ASSIGN:        Loading from dock1.VATime=Loading from dock1.VATime + Diff.VATime;
794$          TALLY:         Loading from dock1.VATimePerEntity,Diff.VATime,1;
759$          RELEASE:       SELECT(TransSet4,LAST),1;
808$          STACK,         1:Destroy:NEXT(807$);

807$          ASSIGN:        Loading from dock1.NumberOut=Loading from dock1.NumberOut + 1:
                             Loading from dock1.WIP=Loading from dock1.WIP-1:NEXT(218$);

218$          ASSIGN:        #loaded1=#loaded1+1:NEXT(46$);


;
;
;     Model statements for module:  Decide 38
;
46$           BRANCH,        1:
                             If,#loaded1==ordersize,810$,Yes:
                             Else,811$,Yes;
810$          ASSIGN:        Decide 38.NumberOut True=Decide 38.NumberOut True + 1:NEXT(44$);

811$          ASSIGN:        Decide 38.NumberOut False=Decide 38.NumberOut False + 1:NEXT(45$);


;
;
;     Model statements for module:  Release 13
;
44$           RELEASE:       dock1,1:NEXT(219$);

219$          ASSIGN:        #loaded1=#loaded1-#loaded1;
230$          TALLY:         time in system from d1 for shipment,tnow-shipmentqenter,1;
235$          COUNT:         # of trucks that are in system  more than 60 minutes from d1,(tnow-shipmentqenter)>60;
245$          COUNT:         # of trucks that are in system  more than 45 minutes from d1,(tnow-shipmentqenter)>45;
236$          COUNT:         #of trucks that are from d1,1;
248$          TALLY:         time for loading at d1,tnow-starting time of loading at d1,1:NEXT(45$);


;
;
;     Model statements for module:  Dispose 13
;
45$           ASSIGN:        Dispose 13.NumberOut=Dispose 13.NumberOut + 1;
812$          DISPOSE:       Yes;

258$          ASSIGN:        #product being loaded from d1=#product being loaded from d1+1:NEXT(260$);


;
;
;     Model statements for module:  Decide 219
;
260$          BRANCH,        1:
                             If,#product being loaded from d1==1,813$,Yes:
                             Else,814$,Yes;
813$          ASSIGN:        Decide 219.NumberOut True=Decide 219.NumberOut True + 1:NEXT(259$);

814$          ASSIGN:        Decide 219.NumberOut False=Decide 219.NumberOut False + 1:NEXT(261$);


;
;
;     Model statements for module:  Assign 177
;
259$          ASSIGN:        starting time of loading at d1=tnow:NEXT(86$);


;
;
;     Model statements for module:  Decide 220
;
261$          BRANCH,        1:
                             If,#product being loaded from d1==7,815$,Yes:
                             Else,816$,Yes;
815$          ASSIGN:        Decide 220.NumberOut True=Decide 220.NumberOut True + 1:NEXT(262$);

816$          ASSIGN:        Decide 220.NumberOut False=Decide 220.NumberOut False + 1:NEXT(86$);

262$          ASSIGN:        #product being loaded from d1=#product being loaded from d1-#product being loaded from d1:NEXT(86$);


;
;
;     Model statements for module:  Delay 17
;
294$          DELAY:         SecondsToBaseTime(((34.521+(0.915*averagedistance)+Norm(0,7.3))*2)),,Other:NEXT(93$);


;
;
;     Model statements for module:  Seize 12
;
50$           QUEUE,         Seizing a forklift from forklift set at shipment ramp2.Queue;
              SEIZE,         2,Other:
                             SELECT(TransSet6,CYC, trans_no6),1:NEXT(818$);

818$          DELAY:         0.0,,VA:NEXT(295$);


;
;
;     Model statements for module:  Decide 234
;
295$          BRANCH,        1:
                             If,departure from stock exceeded<>1,819$,Yes:
                             Else,820$,Yes;
819$          ASSIGN:        Decide 234.NumberOut True=Decide 234.NumberOut True + 1:NEXT(52$);

820$          ASSIGN:        Decide 234.NumberOut False=Decide 234.NumberOut False + 1:NEXT(296$);


;
;
;     Model statements for module:  Delay 8
;
52$           DELAY:         
                             SecondsToBaseTime((Locationtype==1)*((34.521+(0.915*distance10)+NORM(0,7.3))*2)+(Locationtype==2)*((34.521+(0.915*distance12)+NORM(0,7.3))*2)+(Locationtype==3)*((34.521+(0.915*distance14)+NORM(0,7.3))*2)+(Locationtype==4)*((34.521+(0.915*distance16)+NORM(0,7.3))*2)),,
                             Other:NEXT(53$);

53$           RELEASE:       Member(TransSet6, Trans_No6),1;
252$          ASSIGN:        #product from d2=#product from d2+1:NEXT(188$);


;
;
;     Model statements for module:  Decide 122
;
188$          BRANCH,        1:
                             If,#product from d2==8,821$,Yes:
                             Else,822$,Yes;
821$          ASSIGN:        Decide 122.NumberOut True=Decide 122.NumberOut True + 1:NEXT(229$);

822$          ASSIGN:        Decide 122.NumberOut False=Decide 122.NumberOut False + 1:NEXT(254$);

229$          TALLY:         time for pickup to d2,tnow-leave the dock2 queue,1;
253$          ASSIGN:        #product from d2=#product from d2-#product from d2:NEXT(77$);


;
;
;     Model statements for module:  Process 4
;
77$           ASSIGN:        Loading from dock2.NumberIn=Loading from dock2.NumberIn + 1:
                             Loading from dock2.WIP=Loading from dock2.WIP+1;
852$          STACK,         1:Save:NEXT(826$);

826$          QUEUE,         Loading from dock2.Queue;
825$          SEIZE,         1,VA:
                             SELECT(TransSet5,SNB, ),1:NEXT(824$);

824$          DELAY:         SecondsToBaseTime(UNIF(62,83,64)),,VA:NEXT(867$);

867$          ASSIGN:        Loading from dock2.WaitTime=Loading from dock2.WaitTime + Diff.WaitTime;
831$          TALLY:         Loading from dock2.WaitTimePerEntity,Diff.WaitTime,1;
833$          TALLY:         Loading from dock2.TotalTimePerEntity,Diff.StartTime,1;
857$          ASSIGN:        Loading from dock2.VATime=Loading from dock2.VATime + Diff.VATime;
858$          TALLY:         Loading from dock2.VATimePerEntity,Diff.VATime,1;
823$          RELEASE:       SELECT(TransSet5,LAST),1;
872$          STACK,         1:Destroy:NEXT(871$);

871$          ASSIGN:        Loading from dock2.NumberOut=Loading from dock2.NumberOut + 1:
                             Loading from dock2.WIP=Loading from dock2.WIP-1:NEXT(220$);

220$          ASSIGN:        #loaded2=#loaded2+1:NEXT(47$);


;
;
;     Model statements for module:  Decide 39
;
47$           BRANCH,        1:
                             If,#loaded2==ordersize,874$,Yes:
                             Else,875$,Yes;
874$          ASSIGN:        Decide 39.NumberOut True=Decide 39.NumberOut True + 1:NEXT(48$);

875$          ASSIGN:        Decide 39.NumberOut False=Decide 39.NumberOut False + 1:NEXT(49$);


;
;
;     Model statements for module:  Release 14
;
48$           RELEASE:       dock2,1:NEXT(221$);

221$          ASSIGN:        #loaded2=#loaded2-#loaded2;
231$          TALLY:         time in system from d2 for shipment,tnow-shipmentqenter,1;
237$          COUNT:         # of trucks that are in system  more than 60 minutes from d2,(tnow-shipmentqenter)>60;
246$          COUNT:         # of trucks that are in system  more than 45 minutes from d2,(tnow-shipmentqenter)>45;
238$          COUNT:         #of trucks that are from d2,1;
249$          TALLY:         time for loading at d2,tnow-starting time of loading at d2,1:NEXT(49$);


;
;
;     Model statements for module:  Dispose 14
;
49$           ASSIGN:        Dispose 14.NumberOut=Dispose 14.NumberOut + 1;
876$          DISPOSE:       Yes;

254$          ASSIGN:        #product being loaded from d2=#product being loaded from d2+1:NEXT(255$);


;
;
;     Model statements for module:  Decide 217
;
255$          BRANCH,        1:
                             If,#product being loaded from d2==1,877$,Yes:
                             Else,878$,Yes;
877$          ASSIGN:        Decide 217.NumberOut True=Decide 217.NumberOut True + 1:NEXT(247$);

878$          ASSIGN:        Decide 217.NumberOut False=Decide 217.NumberOut False + 1:NEXT(256$);


;
;
;     Model statements for module:  Assign 176
;
247$          ASSIGN:        starting time of loading at d2=tnow:NEXT(77$);


;
;
;     Model statements for module:  Decide 218
;
256$          BRANCH,        1:
                             If,#product being loaded from d2==7,879$,Yes:
                             Else,880$,Yes;
879$          ASSIGN:        Decide 218.NumberOut True=Decide 218.NumberOut True + 1:NEXT(257$);

880$          ASSIGN:        Decide 218.NumberOut False=Decide 218.NumberOut False + 1:NEXT(77$);

257$          ASSIGN:        #product being loaded from d2=#product being loaded from d2-#product being loaded from d2:NEXT(77$);


;
;
;     Model statements for module:  Delay 21
;
296$          DELAY:         SecondsToBaseTime(((34.521+(0.915*averagedistance)+Norm(0,7.3))*2)),,Other:NEXT(53$);


;
;
;     Model statements for module:  Assign 44
;
65$           ASSIGN:        width10=
                             (LocationA(k,1)==4)*0+(LocationA(k,1)==3)*1+(LocationA(k,1)==2)*2+(LocationA(k,1)==1)*3+(LocationA(k,1)==0)*4:
                             distance10=23+k*1+width10:NEXT(38$);


;
;
;     Model statements for module:  Decide 19
;
33$           BRANCH,        1:
                             If,( LocationB(k,1) <> 0 )  &&  ( type == LocationB(k,2) ),881$,Yes:
                             Else,882$,Yes;
881$          ASSIGN:        Decide 19.NumberOut True=Decide 19.NumberOut True + 1:NEXT(34$);

882$          ASSIGN:        Decide 19.NumberOut False=Decide 19.NumberOut False + 1:NEXT(78$);

34$           ASSIGN:        LocationB(k,1)=LocationB(k,1)-1:NEXT(35$);


;
;
;     Model statements for module:  Assign 30
;
35$           ASSIGN:        picked=1:
                             Locationtype=2:NEXT(36$);


;
;
;     Model statements for module:  Decide 21
;
36$           BRANCH,        1:
                             If,LocationB(k,1)==0,883$,Yes:
                             Else,884$,Yes;
883$          ASSIGN:        Decide 21.NumberOut True=Decide 21.NumberOut True + 1:NEXT(37$);

884$          ASSIGN:        Decide 21.NumberOut False=Decide 21.NumberOut False + 1:NEXT(271$);

37$           ASSIGN:        LocationB(k,2)=0:NEXT(271$);


;
;
;     Model statements for module:  Decide 225
;
271$          BRANCH,        1:
                             If,dock_no==1,885$,Yes:
                             Else,886$,Yes;
885$          ASSIGN:        Decide 225.NumberOut True=Decide 225.NumberOut True + 1:NEXT(272$);

886$          ASSIGN:        Decide 225.NumberOut False=Decide 225.NumberOut False + 1:NEXT(273$);


;
;
;     Model statements for module:  Assign 191
;
272$          ASSIGN:        width11=
                             (LocationB(k,1)==4)*0+(LocationB(k,1)==3)*1+(LocationB(k,1)==2)*2+(LocationB(k,1)==1)*3+(LocationB(k,1)==0)*4:
                             distance11=20+k*1+width11:NEXT(38$);


;
;
;     Model statements for module:  Assign 192
;
273$          ASSIGN:        width12=
                             (LocationB(k,1)==4)*0+(LocationB(k,1)==3)*1+(LocationB(k,1)==2)*2+(LocationB(k,1)==1)*3+(LocationB(k,1)==0)*4:
                             distance12=23+k*1+width12:NEXT(38$);


;
;
;     Model statements for module:  Decide 82
;
78$           BRANCH,        1:
                             If,( LocationC(k,1) <> 0 )  &&  ( type == LocationC(k,2) ),887$,Yes:
                             Else,888$,Yes;
887$          ASSIGN:        Decide 82.NumberOut True=Decide 82.NumberOut True + 1:NEXT(79$);

888$          ASSIGN:        Decide 82.NumberOut False=Decide 82.NumberOut False + 1:NEXT(153$);

79$           ASSIGN:        LocationC(k,1)=LocationC(k,1)-1:NEXT(80$);


;
;
;     Model statements for module:  Assign 53
;
80$           ASSIGN:        picked=1:
                             Locationtype=3:NEXT(81$);


;
;
;     Model statements for module:  Decide 83
;
81$           BRANCH,        1:
                             If,LocationC(k,1)==0,889$,Yes:
                             Else,890$,Yes;
889$          ASSIGN:        Decide 83.NumberOut True=Decide 83.NumberOut True + 1:NEXT(82$);

890$          ASSIGN:        Decide 83.NumberOut False=Decide 83.NumberOut False + 1:NEXT(83$);

82$           ASSIGN:        LocationC(k,2)=0:NEXT(83$);


;
;
;     Model statements for module:  Decide 84
;
83$           BRANCH,        1:
                             If,dock_no==1,891$,Yes:
                             Else,892$,Yes;
891$          ASSIGN:        Decide 84.NumberOut True=Decide 84.NumberOut True + 1:NEXT(84$);

892$          ASSIGN:        Decide 84.NumberOut False=Decide 84.NumberOut False + 1:NEXT(85$);


;
;
;     Model statements for module:  Assign 55
;
84$           ASSIGN:        width13=
                             (LocationC(k,1)==7)*0+(LocationC(k,1)==6)*1+(LocationC(k,1)==5)*2+(LocationC(k,1)==4)*3+(LocationC(k,1)==3)*4+(LocationC(k,1)==2)*5+(LocationC(k,1)==1)*6+(LocationC(k,1)==0)*7:
                             distance13=13+k*1+width13:NEXT(38$);


;
;
;     Model statements for module:  Assign 56
;
85$           ASSIGN:        width14=
                             (LocationC(k,1)==7)*0+(LocationC(k,1)==6)*1+(LocationC(k,1)==5)*2+(LocationC(k,1)==4)*3+(LocationC(k,1)==3)*4+(LocationC(k,1)==2)*5+(LocationC(k,1)==1)*6+(LocationC(k,1)==0)*7:
                             distance14=14+k*1+width14:NEXT(38$);


;
;
;     Model statements for module:  Decide 111
;
153$          BRANCH,        1:
                             If,( LocationD(k,1) <> 0 )  &&  ( type == LocationD(k,2) ),893$,Yes:
                             Else,894$,Yes;
893$          ASSIGN:        Decide 111.NumberOut True=Decide 111.NumberOut True + 1:NEXT(154$);

894$          ASSIGN:        Decide 111.NumberOut False=Decide 111.NumberOut False + 1:NEXT(39$);

154$          ASSIGN:        LocationD(k,1)=LocationD(k,1)-1:NEXT(155$);


;
;
;     Model statements for module:  Assign 77
;
155$          ASSIGN:        picked=1:
                             Locationtype=4:NEXT(156$);


;
;
;     Model statements for module:  Decide 112
;
156$          BRANCH,        1:
                             If,LocationD(k,1)==0,895$,Yes:
                             Else,896$,Yes;
895$          ASSIGN:        Decide 112.NumberOut True=Decide 112.NumberOut True + 1:NEXT(157$);

896$          ASSIGN:        Decide 112.NumberOut False=Decide 112.NumberOut False + 1:NEXT(274$);

157$          ASSIGN:        LocationD(k,2)=0:NEXT(274$);


;
;
;     Model statements for module:  Decide 226
;
274$          BRANCH,        1:
                             If,dock_no==1,897$,Yes:
                             Else,898$,Yes;
897$          ASSIGN:        Decide 226.NumberOut True=Decide 226.NumberOut True + 1:NEXT(275$);

898$          ASSIGN:        Decide 226.NumberOut False=Decide 226.NumberOut False + 1:NEXT(276$);


;
;
;     Model statements for module:  Assign 193
;
275$          ASSIGN:        width15=
                             (LocationD(k,1)==7)*0+(LocationD(k,1)==6)*1+(LocationD(k,1)==5)*2+(LocationD(k,1)==4)*3+(LocationD(k,1)==3)*4+(LocationD(k,1)==2)*5+(LocationD(k,1)==1)*6+(LocationD(k,1)==0)*7:
                             distance15=13+k*1+width15:NEXT(38$);


;
;
;     Model statements for module:  Assign 194
;
276$          ASSIGN:        width16=
                             (LocationC(k,1)==7)*0+(LocationC(k,1)==6)*1+(LocationC(k,1)==5)*2+(LocationC(k,1)==4)*3+(LocationC(k,1)==3)*4+(LocationC(k,1)==2)*5+(LocationC(k,1)==1)*6+(LocationC(k,1)==0)*7:
                             distance16=14+k*1+width16:NEXT(38$);


;
;
;     Model statements for module:  Assign 32
;
39$           ASSIGN:        k=k+1:NEXT(287$);


;
;
;     Model statements for module:  Decide 231
;
287$          BRANCH,        1:
                             If,k<=100,899$,Yes:
                             Else,900$,Yes;
899$          ASSIGN:        Decide 231.NumberOut True=Decide 231.NumberOut True + 1:NEXT(38$);

900$          ASSIGN:        Decide 231.NumberOut False=Decide 231.NumberOut False + 1:NEXT(292$);


;
;
;     Model statements for module:  Assign 197
;
292$          ASSIGN:        departure from stock exceeded=1:NEXT(288$);


;
;
;     Model statements for module:  Decide 232
;
288$          BRANCH,        1:
                             If,type==1,289$,Yes:
                             If,type==2,290$,Yes:
                             Else,291$,Yes;
291$          ASSIGN:        stock3=stock3-1:NEXT(42$);

289$          ASSIGN:        stock1=stock1-1:NEXT(42$);

290$          ASSIGN:        stock2=stock2-1:NEXT(42$);

240$          TALLY:         time in shipmentq at d2,tnow-shipmentqenter,1:NEXT(67$);


;
;
;     Model statements for module:  Assign 48
;
67$           ASSIGN:        dock_no=2:
                             leave the dock2 queue=tnow:NEXT(26$);


;
;
;     Model statements for module:  Record 32
;
160$          COUNT:         #runaway,1:NEXT(159$);


;
;
;     Model statements for module:  Dispose 21
;
159$          ASSIGN:        Dispose 21.NumberOut=Dispose 21.NumberOut + 1;
903$          DISPOSE:       Yes;


;
;
;     Model statements for module:  Decide 118
;
168$          BRANCH,        1:
                             If,product1stock>=safety stock,904$,Yes:
                             Else,905$,Yes;
904$          ASSIGN:        Decide 118.NumberOut True=Decide 118.NumberOut True + 1:NEXT(222$);

905$          ASSIGN:        Decide 118.NumberOut False=Decide 118.NumberOut False + 1:NEXT(160$);

222$          COUNT:         dispatchatruck,1:NEXT(24$);


;
;
;     Model statements for module:  Decide 119
;
169$          BRANCH,        1:
                             If,product2stock>=safety stock,906$,Yes:
                             Else,907$,Yes;
906$          ASSIGN:        Decide 119.NumberOut True=Decide 119.NumberOut True + 1:NEXT(223$);

907$          ASSIGN:        Decide 119.NumberOut False=Decide 119.NumberOut False + 1:NEXT(160$);

223$          COUNT:         dispatchbtruck,1:NEXT(24$);


;
;
;     Model statements for module:  Dispose 20
;
108$          ASSIGN:        Dispose 20.NumberOut=Dispose 20.NumberOut + 1;
908$          DISPOSE:       Yes;


;
;
;     Model statements for module:  Assign 73
;
134$          ASSIGN:        departureb2# c1=disc(0.663,0,0.707,1,0.761,2,0.853,3,0.891,4,0.946,5,0.973,6,0.995,7,1,9,98)
                             :NEXT(138$);


;
;
;     Model statements for module:  Decide 106
;
138$          BRANCH,        1:
                             If,departureb2# c1==0,108$,Yes:
                             If,departureb2# c1==1,139$,Yes:
                             Else,140$,Yes;

;
;
;     Model statements for module:  Separate 10
;
140$          DUPLICATE,     100 - 50:
                             departureb2# c1-1,913$,50:NEXT(912$);

912$          ASSIGN:        Separate 10.NumberOut Orig=Separate 10.NumberOut Orig + 1:NEXT(139$);

913$          ASSIGN:        Separate 10.NumberOut Dup=Separate 10.NumberOut Dup + 1:NEXT(139$);


;
;
;     Model statements for module:  Process 15
;
139$          ASSIGN:        Process 15.NumberIn=Process 15.NumberIn + 1:
                             Process 15.WIP=Process 15.WIP+1;
943$          STACK,         1:Save:NEXT(917$);

917$          QUEUE,         Process 15.Queue;
916$          SEIZE,         2,VA:
                             Resource 9,1:NEXT(915$);

915$          DELAY:         HoursToBaseTime(expo(14/departureb2# c1,34)),,VA:NEXT(958$);

958$          ASSIGN:        Process 15.WaitTime=Process 15.WaitTime + Diff.WaitTime;
922$          TALLY:         Process 15.WaitTimePerEntity,Diff.WaitTime,1;
924$          TALLY:         Process 15.TotalTimePerEntity,Diff.StartTime,1;
948$          ASSIGN:        Process 15.VATime=Process 15.VATime + Diff.VATime;
949$          TALLY:         Process 15.VATimePerEntity,Diff.VATime,1;
914$          RELEASE:       Resource 9,1;
963$          STACK,         1:Destroy:NEXT(962$);

962$          ASSIGN:        Process 15.NumberOut=Process 15.NumberOut + 1:
                             Process 15.WIP=Process 15.WIP-1:NEXT(90$);


;
;
;     Model statements for module:  Create 7
;

965$          CREATE,        1,MinutesToBaseTime(0.0001),Entity sc1ship# c1:MinutesToBaseTime(1440):NEXT(966$);

966$          ASSIGN:        Create for shipment c shift1 c1.NumberOut=Create for shipment c shift1 c1.NumberOut + 1:NEXT(141$);


;
;
;     Model statements for module:  Decide 107
;
141$          BRANCH,        1:
                             If,((0+((day)*1440))<=tnow)&&(tnow<=(600+((day)*1440))),969$,Yes:
                             Else,970$,Yes;
969$          ASSIGN:        Decide 107.NumberOut True=Decide 107.NumberOut True + 1:NEXT(142$);

970$          ASSIGN:        Decide 107.NumberOut False=Decide 107.NumberOut False + 1:NEXT(143$);


;
;
;     Model statements for module:  Assign 74
;
142$          ASSIGN:        departurec1# c1=disc(0.842,0,0.891,1,0.924,2,0.935,3,0.962,4,0.978,5,0.995,6,1,7,99):NEXT(144$);


;
;
;     Model statements for module:  Decide 108
;
144$          BRANCH,        1:
                             If,departurec1# c1==0,108$,Yes:
                             If,departurec1# c1==1,145$,Yes:
                             Else,146$,Yes;

;
;
;     Model statements for module:  Separate 11
;
146$          DUPLICATE,     100 - 50:
                             departurec1# c1-1,975$,50:NEXT(974$);

974$          ASSIGN:        Separate 11.NumberOut Orig=Separate 11.NumberOut Orig + 1:NEXT(145$);

975$          ASSIGN:        Separate 11.NumberOut Dup=Separate 11.NumberOut Dup + 1:NEXT(145$);


;
;
;     Model statements for module:  Process 16
;
145$          ASSIGN:        Process 16.NumberIn=Process 16.NumberIn + 1:
                             Process 16.WIP=Process 16.WIP+1;
1005$         STACK,         1:Save:NEXT(979$);

979$          QUEUE,         Process 16.Queue;
978$          SEIZE,         2,VA:
                             Resource 10,1:NEXT(977$);

977$          DELAY:         HoursToBaseTime(expo(10/departurec1# c1,35)),,VA:NEXT(1020$);

1020$         ASSIGN:        Process 16.WaitTime=Process 16.WaitTime + Diff.WaitTime;
984$          TALLY:         Process 16.WaitTimePerEntity,Diff.WaitTime,1;
986$          TALLY:         Process 16.TotalTimePerEntity,Diff.StartTime,1;
1010$         ASSIGN:        Process 16.VATime=Process 16.VATime + Diff.VATime;
1011$         TALLY:         Process 16.VATimePerEntity,Diff.VATime,1;
976$          RELEASE:       Resource 10,1;
1025$         STACK,         1:Destroy:NEXT(1024$);

1024$         ASSIGN:        Process 16.NumberOut=Process 16.NumberOut + 1:
                             Process 16.WIP=Process 16.WIP-1:NEXT(91$);


;
;
;     Model statements for module:  Assign 61
;
91$           ASSIGN:        type=3:NEXT(158$);


;
;
;     Model statements for module:  Assign 75
;
143$          ASSIGN:        departurec2# c1=disc(0.723,0,0.804,1,0.870,2,0.908,3,0.940,4,0.989,5,1,6,100):NEXT(147$);


;
;
;     Model statements for module:  Decide 109
;
147$          BRANCH,        1:
                             If,departurec2# c1==0,108$,Yes:
                             If,departurec2# c1==1,148$,Yes:
                             Else,149$,Yes;

;
;
;     Model statements for module:  Separate 12
;
149$          DUPLICATE,     100 - 50:
                             departurec2# c1-1,1031$,50:NEXT(1030$);

1030$         ASSIGN:        Separate 12.NumberOut Orig=Separate 12.NumberOut Orig + 1:NEXT(148$);

1031$         ASSIGN:        Separate 12.NumberOut Dup=Separate 12.NumberOut Dup + 1:NEXT(148$);


;
;
;     Model statements for module:  Process 17
;
148$          ASSIGN:        Process 17.NumberIn=Process 17.NumberIn + 1:
                             Process 17.WIP=Process 17.WIP+1;
1061$         STACK,         1:Save:NEXT(1035$);

1035$         QUEUE,         Process 17.Queue;
1034$         SEIZE,         2,VA:
                             Resource 11,1:NEXT(1033$);

1033$         DELAY:         HoursToBaseTime(expo(14/departurec2# c1,36)),,VA:NEXT(1076$);

1076$         ASSIGN:        Process 17.WaitTime=Process 17.WaitTime + Diff.WaitTime;
1040$         TALLY:         Process 17.WaitTimePerEntity,Diff.WaitTime,1;
1042$         TALLY:         Process 17.TotalTimePerEntity,Diff.StartTime,1;
1066$         ASSIGN:        Process 17.VATime=Process 17.VATime + Diff.VATime;
1067$         TALLY:         Process 17.VATimePerEntity,Diff.VATime,1;
1032$         RELEASE:       Resource 11,1;
1081$         STACK,         1:Destroy:NEXT(1080$);

1080$         ASSIGN:        Process 17.NumberOut=Process 17.NumberOut + 1:
                             Process 17.WIP=Process 17.WIP-1:NEXT(91$);


;
;
;     Model statements for module:  Create 9
;

1083$         CREATE,        1,HoursToBaseTime(0.0),Entity 1:HoursToBaseTime(24):NEXT(1084$);

1084$         ASSIGN:        Create 9.NumberOut=Create 9.NumberOut + 1:NEXT(98$);


;
;
;     Model statements for module:  Assign 64
;
98$           ASSIGN:        day=day+1:NEXT(99$);


;
;
;     Model statements for module:  Dispose 17
;
99$           ASSIGN:        Dispose 17.NumberOut=Dispose 17.NumberOut + 1;
1087$         DISPOSE:       Yes;


;
;
;     Model statements for module:  Create 11
;

1088$         CREATE,        1,MinutesToBaseTime(600.0001),Entity ra2rec# c1:MinutesToBaseTime(1440):NEXT(1089$);

1089$         ASSIGN:        Create for receiving a shift2 c1.NumberOut=Create for receiving a shift2 c1.NumberOut + 1
                             :NEXT(100$);


;
;
;     Model statements for module:  Decide 93
;
100$          BRANCH,        1:
                             If,((0+((day)*1440))<=tnow)&&(tnow<=(600+((day)*1440))),1092$,Yes:
                             Else,1093$,Yes;
1092$         ASSIGN:        Decide 93.NumberOut True=Decide 93.NumberOut True + 1:NEXT(92$);

1093$         ASSIGN:        Decide 93.NumberOut False=Decide 93.NumberOut False + 1:NEXT(101$);


;
;
;     Model statements for module:  Assign 62
;
92$           ASSIGN:        receipta1# c1=
                             disc(0.772,0,0.777,2,0.788,4,0.810,5,0.821,6,0.832,7,0.870,8,0.886,9,0.891,10,0.908,11,0.924,12,0.935,13,0.946,14,0.951,16,0.962,17,0.973,18,0.978,22,0.984,23,0.995,27,1,32,65)
                             :NEXT(94$);


;
;
;     Model statements for module:  Decide 92
;
94$           BRANCH,        1:
                             If,receipta1# c1==0,95$,Yes:
                             If,receipta1# c1==1,96$,Yes:
                             Else,97$,Yes;

;
;
;     Model statements for module:  Separate 1
;
97$           DUPLICATE,     100 - 50:
                             receipta1# c1-1,1098$,50:NEXT(1097$);

1097$         ASSIGN:        Separate 1.NumberOut Orig=Separate 1.NumberOut Orig + 1:NEXT(96$);

1098$         ASSIGN:        Separate 1.NumberOut Dup=Separate 1.NumberOut Dup + 1:NEXT(96$);


;
;
;     Model statements for module:  Process 6
;
96$           ASSIGN:        Process 6.NumberIn=Process 6.NumberIn + 1:
                             Process 6.WIP=Process 6.WIP+1;
1128$         STACK,         1:Save:NEXT(1102$);

1102$         QUEUE,         Process 6.Queue;
1101$         SEIZE,         2,VA:
                             Resource 1,1:NEXT(1100$);

1100$         DELAY:         HoursToBaseTime(expo(10/receipta1# c1,1)),,VA:NEXT(1143$);

1143$         ASSIGN:        Process 6.WaitTime=Process 6.WaitTime + Diff.WaitTime;
1107$         TALLY:         Process 6.WaitTimePerEntity,Diff.WaitTime,1;
1109$         TALLY:         Process 6.TotalTimePerEntity,Diff.StartTime,1;
1133$         ASSIGN:        Process 6.VATime=Process 6.VATime + Diff.VATime;
1134$         TALLY:         Process 6.VATimePerEntity,Diff.VATime,1;
1099$         RELEASE:       Resource 1,1;
1148$         STACK,         1:Destroy:NEXT(1147$);

1147$         ASSIGN:        Process 6.NumberOut=Process 6.NumberOut + 1:
                             Process 6.WIP=Process 6.WIP-1:NEXT(0$);


;
;
;     Model statements for module:  Assign 1
;
0$            ASSIGN:        producttype=1:NEXT(180$);


;
;
;     Model statements for module:  Assign 65
;
101$          ASSIGN:        receipta2# c2=
                             disc(0.810,0,0.821,1,0.832,2,0.848,4,0.853,5,0.864,6,0.880,7,0.886,8,0.891,9,0.902,10,0.913,11,0.918,12,0.924,13,0.929,14,0.940,15,0.946,16,0.962,18,0.973,20,0.978,23,0.984,26,0.989,28,0.995,29,1,36,66)
                             :NEXT(102$);


;
;
;     Model statements for module:  Decide 94
;
102$          BRANCH,        1:
                             If,receipta2# c1==0,95$,Yes:
                             If,receipta2# c1==1,113$,Yes:
                             Else,103$,Yes;

;
;
;     Model statements for module:  Separate 2
;
103$          DUPLICATE,     100 - 50:
                             receipta2# c1-1,1154$,50:NEXT(1153$);

1153$         ASSIGN:        Separate 2.NumberOut Orig=Separate 2.NumberOut Orig + 1:NEXT(113$);

1154$         ASSIGN:        Separate 2.NumberOut Dup=Separate 2.NumberOut Dup + 1:NEXT(113$);


;
;
;     Model statements for module:  Process 8
;
113$          ASSIGN:        Process 8.NumberIn=Process 8.NumberIn + 1:
                             Process 8.WIP=Process 8.WIP+1;
1184$         STACK,         1:Save:NEXT(1158$);

1158$         QUEUE,         Process 8.Queue;
1157$         SEIZE,         2,VA:
                             Resource 2,1:NEXT(1156$);

1156$         DELAY:         HoursToBaseTime(expo(14/receipta2# c1,2)),,VA:NEXT(1199$);

1199$         ASSIGN:        Process 8.WaitTime=Process 8.WaitTime + Diff.WaitTime;
1163$         TALLY:         Process 8.WaitTimePerEntity,Diff.WaitTime,1;
1165$         TALLY:         Process 8.TotalTimePerEntity,Diff.StartTime,1;
1189$         ASSIGN:        Process 8.VATime=Process 8.VATime + Diff.VATime;
1190$         TALLY:         Process 8.VATimePerEntity,Diff.VATime,1;
1155$         RELEASE:       Resource 2,1;
1204$         STACK,         1:Destroy:NEXT(1203$);

1203$         ASSIGN:        Process 8.NumberOut=Process 8.NumberOut + 1:
                             Process 8.WIP=Process 8.WIP-1:NEXT(0$);


;
;
;     Model statements for module:  Create 15
;

1206$         CREATE,        1,MinutesToBaseTime(600.0001),Entity sa2ship# c1:MinutesToBaseTime(1440):NEXT(1207$);

1207$         ASSIGN:        Create for shipmenta shift2 c1.NumberOut=Create for shipmenta shift2 c1.NumberOut + 1:NEXT(105$);


;
;
;     Model statements for module:  Decide 95
;
105$          BRANCH,        1:
                             If,((0+((day)*1440))<=tnow)&&(tnow<=(600+((day)*1440))),1210$,Yes:
                             Else,1211$,Yes;
1210$         ASSIGN:        Decide 95.NumberOut True=Decide 95.NumberOut True + 1:NEXT(104$);

1211$         ASSIGN:        Decide 95.NumberOut False=Decide 95.NumberOut False + 1:NEXT(106$);


;
;
;     Model statements for module:  Assign 66
;
104$          ASSIGN:        departurea1# c1=disc(0.332,0,0.386,1,0.5,2,0.707,3,0.859,4,0.946,5,0.984,6,0.989,7,0.995,8,1,10,95)
                             :NEXT(107$);


;
;
;     Model statements for module:  Decide 96
;
107$          BRANCH,        1:
                             If,departurea1# c1==0,108$,Yes:
                             If,departurea1# c1==1,109$,Yes:
                             Else,110$,Yes;

;
;
;     Model statements for module:  Separate 3
;
110$          DUPLICATE,     100 - 50:
                             departurea1# c1-1,1216$,50:NEXT(1215$);

1215$         ASSIGN:        Separate 3.NumberOut Orig=Separate 3.NumberOut Orig + 1:NEXT(109$);

1216$         ASSIGN:        Separate 3.NumberOut Dup=Separate 3.NumberOut Dup + 1:NEXT(109$);


;
;
;     Model statements for module:  Process 7
;
109$          ASSIGN:        Process 7.NumberIn=Process 7.NumberIn + 1:
                             Process 7.WIP=Process 7.WIP+1;
1246$         STACK,         1:Save:NEXT(1220$);

1220$         QUEUE,         Process 7.Queue;
1219$         SEIZE,         2,VA:
                             Resource 3,1:NEXT(1218$);

1218$         DELAY:         HoursToBaseTime(expo(10/departurea1# c1,31)),,VA:NEXT(1261$);

1261$         ASSIGN:        Process 7.WaitTime=Process 7.WaitTime + Diff.WaitTime;
1225$         TALLY:         Process 7.WaitTimePerEntity,Diff.WaitTime,1;
1227$         TALLY:         Process 7.TotalTimePerEntity,Diff.StartTime,1;
1251$         ASSIGN:        Process 7.VATime=Process 7.VATime + Diff.VATime;
1252$         TALLY:         Process 7.VATimePerEntity,Diff.VATime,1;
1217$         RELEASE:       Resource 3,1;
1266$         STACK,         1:Destroy:NEXT(1265$);

1265$         ASSIGN:        Process 7.NumberOut=Process 7.NumberOut + 1:
                             Process 7.WIP=Process 7.WIP-1:NEXT(89$);


;
;
;     Model statements for module:  Assign 59
;
89$           ASSIGN:        type=1:NEXT(158$);


;
;
;     Model statements for module:  Assign 67
;
106$          ASSIGN:        departurea2# c1=disc(0.315,0,0.408,1,0.505,2,0.685,3,0.837,4,0.929,5,0.989,6,1,7,96):NEXT(111$);


;
;
;     Model statements for module:  Decide 97
;
111$          BRANCH,        1:
                             If,departurea2# c1==0,108$,Yes:
                             If,departurea2# c1==1,114$,Yes:
                             Else,112$,Yes;

;
;
;     Model statements for module:  Separate 4
;
112$          DUPLICATE,     100 - 50:
                             departurea2# c1-1,1272$,50:NEXT(1271$);

1271$         ASSIGN:        Separate 4.NumberOut Orig=Separate 4.NumberOut Orig + 1:NEXT(114$);

1272$         ASSIGN:        Separate 4.NumberOut Dup=Separate 4.NumberOut Dup + 1:NEXT(114$);


;
;
;     Model statements for module:  Process 9
;
114$          ASSIGN:        Process 9.NumberIn=Process 9.NumberIn + 1:
                             Process 9.WIP=Process 9.WIP+1;
1302$         STACK,         1:Save:NEXT(1276$);

1276$         QUEUE,         Process 9.Queue;
1275$         SEIZE,         2,VA:
                             Resource 4,1:NEXT(1274$);

1274$         DELAY:         HoursToBaseTime(expo(14/departurea2# c1,32)),,VA:NEXT(1317$);

1317$         ASSIGN:        Process 9.WaitTime=Process 9.WaitTime + Diff.WaitTime;
1281$         TALLY:         Process 9.WaitTimePerEntity,Diff.WaitTime,1;
1283$         TALLY:         Process 9.TotalTimePerEntity,Diff.StartTime,1;
1307$         ASSIGN:        Process 9.VATime=Process 9.VATime + Diff.VATime;
1308$         TALLY:         Process 9.VATimePerEntity,Diff.VATime,1;
1273$         RELEASE:       Resource 4,1;
1322$         STACK,         1:Destroy:NEXT(1321$);

1321$         ASSIGN:        Process 9.NumberOut=Process 9.NumberOut + 1:
                             Process 9.WIP=Process 9.WIP-1:NEXT(89$);


;
;
;     Model statements for module:  Create 16
;

1324$         CREATE,        1,MinutesToBaseTime(600.0001),Entity rb2rec# c1:MinutesToBaseTime(1440):NEXT(1325$);

1325$         ASSIGN:        Create for receiving b shift2 c1.NumberOut=Create for receiving b shift2 c1.NumberOut + 1
                             :NEXT(115$);


;
;
;     Model statements for module:  Create 17
;

1328$         CREATE,        1,MinutesToBaseTime(600.0001),Entity rc2rec# c1:MinutesToBaseTime(1440):NEXT(1329$);

1329$         ASSIGN:        Create for receiving c shift2 c1.NumberOut=Create for receiving c shift2 c1.NumberOut + 1
                             :NEXT(123$);


;
;
;     Model statements for module:  Create 19
;

1332$         CREATE,        1,MinutesToBaseTime(600.0001),Entity sb2ship# c1:MinutesToBaseTime(1440):NEXT(1333$);

1333$         ASSIGN:        Create for shipment b shift2 c1.NumberOut=Create for shipment b shift2 c1.NumberOut + 1:NEXT(132$);


176$          CREATE,        1,TFIN:,1:NEXT(177$);

177$          WRITE,         rqueueoutput:
                             
                             tavg(time in receiptq at d1),tavg(time in receiptq at d2),davg(statistic 1),davg(statistic 2),davg(statistic 3),dmax(statistic 1), dmax(statistic 2),dmax(statistic 3),davg(statistic 4),davg(statistic 5),davg(statistic 6),dmax(statistic 4),dmax(statistic 5),dmax(statistic 6),davg(statistic 7),dmax(statistic 7),davg(statistic 8),dmax(statistic 8);
178$          DISPOSE:       No;


185$          CREATE,        1,TFIN:,1:NEXT(186$);

186$          WRITE,         rtimeinsystem:
                             
                             tavg(time in system from d1), tavg(time in system from d2),tavg(time for putaway from d1),tavg(time for putaway from d2);
187$          DISPOSE:       No;


190$          CREATE,        1,TFIN::NEXT(191$);

191$          WRITE,         utilizationf1:
                             FSTAND(forklift1,1),FSTAND(forklift1,2),FSTAND(forklift1,4);
192$          DISPOSE:       No;


193$          CREATE,        1,TFIN::NEXT(194$);

194$          WRITE,         utilizationf2:
                             FSTAND(forklift2,1),FSTAND(forklift2,2),FSTAND(forklift2,4);
195$          DISPOSE:       No;


196$          CREATE,        1,TFIN::NEXT(197$);

197$          WRITE,         utilizationf3:
                             FSTAND(forklift3,1),FSTAND(forklift3,2),FSTAND(forklift3,4);
198$          DISPOSE:       No;


199$          CREATE,        1,TFIN::NEXT(200$);

200$          WRITE,         utilizationf4:
                             FSTAND(forklift4,1),FSTAND(forklift4,2),FSTAND(forklift4,4);
201$          DISPOSE:       No;


202$          CREATE,        1,TFIN::NEXT(203$);

203$          WRITE,         utilizationf5:
                             FSTAND(forklift5,1),FSTAND(forklift5,2),FSTAND(forklift5,4);
204$          DISPOSE:       No;


205$          CREATE,        1,TFIN::NEXT(206$);

206$          WRITE,         utilizationf6:
                             FSTAND(forklift6,1),FSTAND(forklift6,2),FSTAND(forklift6,4);
207$          DISPOSE:       No;


208$          CREATE,        1,TFIN::NEXT(209$);

209$          WRITE,         utilizationd1:
                             FSTAND(dock 1,1),FSTAND(dock 1,2),FSTAND(dock 1,4);
210$          DISPOSE:       No;


211$          CREATE,        1,TFIN::NEXT(212$);

212$          WRITE,         utilizationd2:
                             FSTAND(dock 2,1),FSTAND(dock 2,2),FSTAND(dock 2,4);
213$          DISPOSE:       No;


225$          CREATE,        1,TFIN:,1:NEXT(226$);

226$          WRITE,         squeueoutput:
                             
                             tavg(time in shipmentq at d1),tavg(time in shipmentq at d2),nc(receiptatruck),nc(receiptbtruck),nc(receiptctruck),nc(dispatchatruck),nc(dispatchbtruck),nc(dispatchctruck),nc(#runaway),tavg(time for pickup to d1),tavg(time for pickup to d2),tavg(time for loading at d1),tavg(time for loading at d2);
227$          DISPOSE:       No;


232$          CREATE,        1,TFIN:,1:NEXT(233$);

233$          WRITE,         stimeinsystem:
                             
                             tavg(time in system from d1 for shipment),nc(# of trucks that are in system  more than 60 minutes from d1),nc(#of trucks that are from d1),tavg(time in system from d2 for shipment),nc(# of trucks that are in system  more than 60 minutes from d2),nc(#of trucks that are from d2),nc(# of trucks that are in system  more than 45 minutes from d1),nc(# of trucks that are in system  more than 45 minutes from d2);
234$          DISPOSE:       No;


;
;
;     Model statements for module:  Create 100
;

1336$         CREATE,        1,MinutesToBaseTime(0.0001),Entity ra1rec# c1:MinutesToBaseTime(1440):NEXT(1337$);

1337$         ASSIGN:        Create for receiving a shift1 c1.NumberOut=Create for receiving a shift1 c1.NumberOut + 1
                             :NEXT(100$);


;
;
;     Model statements for module:  Create 101
;

1340$         CREATE,        1,MinutesToBaseTime(0.0001),Entity sa1ship# c1:MinutesToBaseTime(1440):NEXT(1341$);

1341$         ASSIGN:        Create for shipmenta shift1 c1.NumberOut=Create for shipmenta shift1 c1.NumberOut + 1:NEXT(105$);


;
;
;     Model statements for module:  Create 109
;

1344$         CREATE,        1,MinutesToBaseTime(600.0001),Entity sc2ship# c1:MinutesToBaseTime(1440):NEXT(1345$);

1345$         ASSIGN:        Create for shipment c shift2 c1.NumberOut=Create for shipment c shift2 c1.NumberOut + 1:NEXT(141$);









